#!/usr/bin/python
# -*- coding: utf-8 -*-
# 曹志强
# 2019.11.20
from django.db import models


# 基本的类型
class BaseModel(models.Model):
    addtime = models.DateTimeField(verbose_name='添加时间',editable=False,auto_now_add=True)
    modifytime = models.DateTimeField(verbose_name='修改时间', auto_now=True,editable=False)
    isdelete = models.BooleanField(verbose_name="是否删除", default=False,editable=False)

    class Meta:
        abstract = True


# 名称
class NameModel(BaseModel):
    name = models.CharField(verbose_name="名称", max_length=50,default=None)

    def __str__(self):
        return self.name

    class Meta:
        abstract = True

# 短名称
class NameShortModel(BaseModel):
    name = models.CharField(verbose_name="名称", max_length=20,default=None)

    def __str__(self):
        return self.name

    class Meta:
        abstract = True
# 长名称
class NameLongModel(BaseModel):
    name = models.CharField(verbose_name="名称", max_length=50,default=None)

    def __str__(self):
        return self.name

    class Meta:
        abstract = True